import request from '@/utils/request'

export default {
  //讲师列表（条件查询分页）
  getTeacherListPage(current, limit, teacherQuery) {
    return request({
      url: `/serviceEdu/teacher/pageTeacherCondition/${current}/${limit}`,
      method: 'post',
      //data表示把对象转换成json进行传递到接口里面
      data: teacherQuery
    })
  },
  //删除讲师
  removeById(teacherId){
    return request({
      //url: `${api_name}/${teacherId}`,
      url: `/serviceEdu/teacher/${teacherId}`,
      method: 'delete'
    });
  },
  //添加讲师
  addTeache(teacher){
    return request({
      //url: `${api_name}/${teacherId}`,
      url: `/serviceEdu/teacher/addTeacher`,
      method: 'post',
      data:teacher
    });
  },
  //根据ID查询讲师
  getTeacherInfo(id){
    return request({
      url: `/serviceEdu/teacher/getTeacher/${id}`,
      method: 'get'
    });
  },
  //修改讲师
  updateTeacherInfo(teacher){
    return request({
      url: `/serviceEdu/teacher/updateTeacher`,
      method: 'post',
      data:teacher
    });
  }
}
